---
title: "Customize Form - States Table"
space: "Frappe Framework"
url: "https://support.aakvatech.com/Frappe Framework/customize-form-states-table"
updated: "2026-07-22"
---

<p>The <strong><code>states</code></strong> table in the <strong>Customize Form</strong> Doctype allows users to define custom states (or statuses) for a Doctype, often used in workflows. Each row in the <strong><code>states</code></strong> table represents a specific state and includes fields that determine its behavior and display. Here’s an explanation of each field and its usage:</p>
<hr>
<h3 id="-1-title-"><strong>1. <code>title</code></strong></h3>
<ul>
<li><strong>Description:</strong> The name of the state or status.</li>
<li><strong>Use:</strong><ul>
<li>Represents the current state of a document (e.g., &quot;Draft,&quot; &quot;Pending Approval,&quot; &quot;Approved&quot;).</li>
<li>Displayed prominently in the document header or workflow status field.</li>
</ul>
</li>
</ul>
<hr>
<h3 id="-2-color-"><strong>2. <code>color</code></strong></h3>
<ul>
<li><strong>Description:</strong> Defines the color associated with the state.</li>
<li><strong>Use:</strong><ul>
<li>Helps visually differentiate between states.</li>
<li>Commonly used colors include green for &quot;Approved,&quot; red for &quot;Rejected,&quot; and yellow for &quot;Pending.&quot;</li>
<li>Accepts color codes or predefined labels like &quot;Red,&quot; &quot;Green,&quot; etc.</li>
</ul>
</li>
</ul>
<hr>
<h3 id="-3-idx-"><strong>3. <code>idx</code></strong></h3>
<ul>
<li><strong>Description:</strong> Specifies the order of the states in the list.</li>
<li><strong>Use:</strong><ul>
<li>Controls the sequence in which states are displayed.</li>
<li>Ensure logical progression (e.g., &quot;Draft&quot; → &quot;Submitted&quot; → &quot;Approved&quot;).</li>
</ul>
</li>
</ul>
<hr>
<h3 id="-4-group-"><strong>4. <code>group</code></strong></h3>
<ul>
<li><strong>Description:</strong> Categorizes the state under a specific group.</li>
<li><strong>Use:</strong><ul>
<li>Organize states for easier management.</li>
<li>For example, grouping states under &quot;Approval Flow&quot; or &quot;Completion Stages.&quot;</li>
</ul>
</li>
</ul>
<hr>
<h3 id="-5-hidden-"><strong>5. <code>hidden</code></strong></h3>
<ul>
<li><strong>Description:</strong> Determines whether the state is hidden from the user interface.</li>
<li><strong>Use:</strong><ul>
<li>Hide states that are only relevant for backend processes or specific users.</li>
<li>For example, a temporary state used for automated processing.</li>
</ul>
</li>
</ul>
<hr>
<h3 id="-examples-of-usage-"><strong>Examples of Usage:</strong></h3>
<ol>
<li><strong>Basic Workflow States:</strong><ul>
<li><strong>Row 1:</strong><ul>
<li><code>title</code>: Draft</li>
<li><code>color</code>: Grey</li>
<li><strong>Use:</strong> Represents a document that is being edited but not yet finalized.</li>
</ul>
</li>
<li><strong>Row 2:</strong><ul>
<li><code>title</code>: Submitted</li>
<li><code>color</code>: Blue</li>
<li><strong>Use:</strong> Indicates the document has been finalized and submitted for review.</li>
</ul>
</li>
<li><strong>Row 3:</strong><ul>
<li><code>title</code>: Approved</li>
<li><code>color</code>: Green</li>
<li><strong>Use:</strong> Marks the document as approved.</li>
</ul>
</li>
</ul>
</li>
</ol>
<hr>
<ol>
<li><strong>Advanced Workflow States with Hidden States:</strong><ul>
<li><strong>Row 1:</strong><ul>
<li><code>title</code>: Draft</li>
<li><code>color</code>: Grey</li>
</ul>
</li>
<li><strong>Row 2:</strong><ul>
<li><code>title</code>: Under Review</li>
<li><code>color</code>: Yellow</li>
</ul>
</li>
<li><strong>Row 3:</strong><ul>
<li><code>title</code>: Sent Back</li>
<li><code>color</code>: Orange</li>
</ul>
</li>
<li><strong>Row 4:</strong><ul>
<li><code>title</code>: Automated Processing</li>
<li><code>color</code>: Red</li>
<li><code>hidden</code>: Checked</li>
<li><strong>Use:</strong> A hidden state used for system-generated actions, not visible to users.</li>
</ul>
</li>
</ul>
</li>
</ol>
<hr>
<ol>
<li><strong>Grouped States for Better Organization:</strong><ul>
<li><strong>Row 1:</strong><ul>
<li><code>title</code>: In Progress</li>
<li><code>color</code>: Blue</li>
<li><code>group</code>: Task Flow</li>
</ul>
</li>
<li><strong>Row 2:</strong><ul>
<li><code>title</code>: Completed</li>
<li><code>color</code>: Green</li>
<li><code>group</code>: Task Flow</li>
</ul>
</li>
<li><strong>Row 3:</strong><ul>
<li><code>title</code>: Canceled</li>
<li><code>color</code>: Red</li>
<li><code>group</code>: Task Flow</li>
</ul>
</li>
</ul>
</li>
</ol>
<hr>
<ol>
<li><strong>Custom States for a Leave Application:</strong><ul>
<li><strong>Row 1:</strong><ul>
<li><code>title</code>: Draft</li>
<li><code>color</code>: Grey</li>
<li><strong>Use:</strong> Default state for newly created leave applications.</li>
</ul>
</li>
<li><strong>Row 2:</strong><ul>
<li><code>title</code>: Pending Approval</li>
<li><code>color</code>: Yellow</li>
<li><strong>Use:</strong> Indicates that the leave application is waiting for manager approval.</li>
</ul>
</li>
<li><strong>Row 3:</strong><ul>
<li><code>title</code>: Approved</li>
<li><code>color</code>: Green</li>
<li><strong>Use:</strong> Marks the leave application as approved.</li>
</ul>
</li>
<li><strong>Row 4:</strong><ul>
<li><code>title</code>: Rejected</li>
<li><code>color</code>: Red</li>
<li><strong>Use:</strong> Indicates the leave application has been rejected.</li>
</ul>
</li>
</ul>
</li>
</ol>
<hr>
<h3 id="-how-states-are-used-in-workflows-"><strong>How States Are Used in Workflows:</strong></h3>
<ul>
<li><strong>Display in Document Header:</strong><ul>
<li>The state is often displayed prominently at the top of the document.</li>
</ul>
</li>
<li><strong>Trigger Actions:</strong><ul>
<li>States can trigger specific actions or transitions in workflows (e.g., send notifications on state change).</li>
</ul>
</li>
<li><strong>Filter and Reports:</strong><ul>
<li>Documents can be filtered by states (e.g., show all &quot;Pending Approval&quot; documents).</li>
</ul>
</li>
<li><strong>Visual Indicators:</strong><ul>
<li>Colors and titles make it easy to understand the current state of a document at a glance.</li>
</ul>
</li>
</ul>
<p>By defining custom states in the <strong><code>states</code></strong> table, you can enhance the usability of workflows and improve document management within your ERP system.</p>
